from django.contrib.admin.options import HORIZONTAL, VERTICAL
from django.contrib.admin.sites import AlreadyRegistered
from django.utils.translation import ugettext_lazy as _

from curator.options import ModelAdmin, StackedInline, TabularInline
from curator.sites import AdminSite, site


def autodiscover():
    import imp
    from django.conf import settings

    for app in settings.INSTALLED_APPS:
        if not app.startswith('django.contrib'):
            try:
                app_path = __import__(app, {}, {}, [app.split('.')[-1]]).__path__
            except AttributeError:
                continue
            try:
                imp.find_module('admin', app_path)
            except ImportError:
                continue
            __import__("%s.admin" % app)
